package org.qiancizhan;

import org.qiancizhan.Config.MySQL;
import org.qiancizhan.Config.RedisConfig;
import org.qiancizhan.Model.POJO.UserPOJO;
import org.qiancizhan.UI.IndexUI;
import org.qiancizhan.UI.UserUI;
import org.qiancizhan.Utils.ThreadLocalUtil;

public class Main {
    public static void main(String[] args) {
        new MySQL();
        new RedisConfig();
        //demo测试直接登录
//        ThreadLocalUtil.set(new UserPOJO(2,"admin", "123456"));

        UserPOJO map = ThreadLocalUtil.get();
        System.out.println("欢迎来到千词斩!");
        if(map == null){
            UserUI.showLoginMenu();
        }
        else
            IndexUI.showIndexMenu();
    }
}